const { postModel } = require('../models/postModel');
const { p_childrenModel } = require('../models/p_childrenModel');

//获取岗位
async function findPost(req, res, next) {
    const { type , value} = req.body;
    console.log(type , value);
    let posts = await postModel.find({ [type]:{ $regex:value, $options:'$i' } });
    let post_childrens = await p_childrenModel.find();
    posts.push(...post_childrens)
    res.send(posts)
}

module.exports = {
    findPost
}